home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-08-19 | 13.6 KB | 515 lines | [TEXT/pdos] |
- /* RezIIGS source file for LeMaze */
-
- /* this gives use access to the "standard" pre-defined resource types */
- #include "Types.rez"
-
- /*---------------------- Startup Record ---------------------------*/
- resource rToolStartup (1)
- {
- $C080, /* set master SCB to mode640 + fFastPortAware + fUseShadowing */
- {
- 3,$0300, /* misc tools */
- 4,$0302, /* quickdraw */
- 5,$0302, /* desk manager */
- 6,$0300, /* eventMgr */
- 11,$0300, /* int math */
- 14,$0301, /* Window Manager */
- 15,$0301, /* Menu Manager */
- 16,$0300, /* Control Manager */
- 18,$0301, /* QD Aux */
- 19,$0300, /* print manager */
- 20,$0301, /* LineEdit tool set */
- 21,$0302, /* Dialog Manager */
- 22,$0300, /* Scrap manager */
- 23,$0301, /* standard file */
- 27,$0301, /* Font manager */
- 28,$0301, /* list manager */
- 34,$0101, /* text edit */
- }
- };
-
- /*---------------------- Menus & Menu Bars ---------------------------*/
- /* define the resource id of the menu bar itself */
- #define kMenuBarID1 1
-
- /* define all the menu id's */
- #define kAppleMID 1000
- #define kFileMID 2000
- #define kEditMID 3000
-
- /* now, define the menu item id's */
- #define kAboutBoxIID 1001 /* the "About..." box */
-
- #define kNewItem 2001 /* the "New" item */
- #define kOpenItem 2002 /* the "Open..." item */
- #define kCloseItem 255 /* the "Close" item */
- #define kSaveItem 2004 /* the "Save" item */
- #define kSaveAsItem 2005 /* the "Save As..." item */
- #define kQuitItem 2009 /* the "Quit" item */
-
- #define kUndoItem 250 /* the "Undo" item */
- #define kCutItem 251 /* the "Cut" item */
- #define kCopyItem 252 /* the "Copy" item */
- #define kPasteItem 253 /* the "Paste" item */
- #define kClearItem 254 /* the "Clear" item */
- #define kSelectItem 3001 /* the "Select All" item */
- #define kShowClipItem 3002 /* the "Show Clipboard" item */
-
- /* now, define the menu bar */
- resource rMenuBar (kMenuBarID1)
- {
- {
- kAppleMID,
- kFileMID,
- kEditMID,
- };
- };
-
-
- /* lay out the Apple menu */
- /* this takes several steps: */
- /* 1) define the menu itself in a resource of type "rMenu" */
- /* 2) define the rPString that will be used for the name of the menu */
- /* 3) define the first item in the menu in a resource of type "rMenuItem" */
- /* 4) define the rPString that will be used for the name of the first item */
- /* 5) repeat steps 3 and 4 for all remaining items in that menu */
- /* 6) repeat steps 1 through 5 for all remaining menus */
-
- resource rMenu (kAppleMID, nocrossbank)
- {
- kAppleMID, /* ID of the menu this item belongs to */
- 0xA008, /* flags => menu title is a resource, items are resources, menu */
- /* is enabled, XOR highlighting, std menu, caching ok */
- kAppleMID, /* ref to menu's title */
- { kAboutBoxIID }; /* array of items in this menu (only 1 to start with) */
- };
-
- resource rPString (kAppleMID, nocrossbank)
- {
- "@" /* this string is the title of the "Apple" menu */
- };
-
- /* see IIGS Toolbox Reference, Volume 3, menu item template */
- resource rMenuItem (kAboutBoxIID, nocrossbank)
- {
- kAboutBoxIID, /* item's ID */
- "", /* no keyboard equivalent */
- "", /* no keyboard equivalent (allowed 2, this is the 2nd) */
- 0, /* this item does not have a check mark by it */
- 0x8040, /* title is in a resource, enabled (bit 7=0), */
- /* dividing line below (bit 6=1) */
- kAboutBoxIID /* ref of the item's title */
- };
-
- resource rPString (kAboutBoxIID, nocrossbank)
- {
- "About rTutor" /* used as the title for the "About..." item */
- };
-
-
- /* lay out the File menu */
-
- resource rMenu (kFileMID, nocrossbank)
- {
- kFileMID, /* ID of the menu this item belongs to */
- 0xA008, /* flags => menu title is a resource, items are resources, */
- /* menu is enabled, don't use XOR highlighting, std menu, */
- /* caching ok */
- kFileMID, /* ref to menu's title */
- { /* array of items in this menu */
- kNewItem,
- kOpenItem,
- kCloseItem,
- kSaveItem,
- kSaveAsItem,
- kQuitItem
- };
- };
-
- resource rPString (kFileMID, nocrossbank)
- {
- " File " /* this string is the title of the "File" menu */
- };
-
- resource rMenuItem (kNewItem, nocrossbank)
- {
- kNewItem, /* item's ID */
- "N", /* keyboard equivalent = "N" */
- "n", /* or = "n" (either key will work) */
- 0, /* this item does not have a check mark by it */
- 0x8000, /* title is in a resource, enabled (bit 7 = 0) */
- kNewItem /* ref of the item's title */
- };
-
- resource rPString (kNewItem, nocrossbank)
- {
- "New" /* this string is used as the title for the "New" item */
- };
-
- resource rMenuItem (kOpenItem, nocrossbank)
- {
- kOpenItem,
- "O", /* that's an "OH" on this line, not a "zero" */
- "o", /* that's an "OH" on this line, not a "zero" */
- 0, /* this one's a "zero" */
- 0x8040, /* the "4" means put a dividing line under this item */
- kOpenItem
- };
-
- resource rPString (kOpenItem, nocrossbank)
- {
- "Open..."
- };
-
- resource rMenuItem (kCloseItem, nocrossbank)
- {
- kCloseItem,
- "W",
- "w",
- 0,
- 0x8000,
- kCloseItem
- };
-
- resource rPString (kCloseItem, nocrossbank)
- {
- "Close"
- };
-
- resource rMenuItem (kSaveItem, nocrossbank)
- {
- kSaveItem,
- "S",
- "s",
- 0,
- 0x8000,
- kSaveItem
- };
-
- resource rPString (kSaveItem, nocrossbank)
- {
- "Save"
- };
-
- resource rMenuItem (kSaveAsItem, nocrossbank)
- {
- kSaveAsItem,
- "", /* no key equivalents for this item */
- "",
- 0,
- 0x8000,
- kSaveAsItem
- };
-
- resource rPString (kSaveAsItem, nocrossbank)
- {
- "Save As..."
- };
-
- resource rMenuItem (kQuitItem, nocrossbank)
- {
- kQuitItem,
- "Q",
- "q",
- 0,
- 0x8000,
- kQuitItem
- };
-
- resource rPString (kQuitItem, nocrossbank)
- {
- "Quit"
- };
-
-
- /* lay out the Edit menu */
-
- resource rMenu (kEditMID, nocrossbank)
- {
- kEditMID, /* ID of the menu this item belongs to */
- 0xA008,
- kEditMID, /* ref to menu's title */
- { /* array of items in this menu */
- kUndoItem,
- kCutItem,
- kCopyItem,
- kPasteItem,
- kClearItem,
- kSelectItem,
- kShowClipItem
- };
- };
-
- resource rPString (kEditMID, nocrossbank)
- {
- " Edit " /* this string is the title of the "Edit" menu */
- };
-
- resource rMenuItem (kUndoItem, nocrossbank)
- {
- kUndoItem,
- "Z",
- "z",
- 0,
- 0x8040,
- kUndoItem
- };
-
- resource rPString (kUndoItem, nocrossbank)
- {
- "Undo"
- };
-
- resource rMenuItem (kCutItem, nocrossbank)
- {
- kCutItem,
- "X",
- "x",
- 0,
- 0x8000,
- kCutItem
- };
-
- resource rPString (kCutItem, nocrossbank)
- {
- "Cut"
- };
-
- resource rMenuItem (kCopyItem, nocrossbank)
- {
- kCopyItem,
- "C",
- "c",
- 0,
- 0x8000,
- kCopyItem
- };
-
- resource rPString (kCopyItem, nocrossbank)
- {
- "Copy"
- };
-
- resource rMenuItem (kPasteItem, nocrossbank)
- {
- kPasteItem,
- "V",
- "v",
- 0,
- 0x8000,
- kPasteItem
- };
-
- resource rPString (kPasteItem, nocrossbank)
- {
- "Paste"
- };
-
- resource rMenuItem (kClearItem, nocrossbank)
- {
- kClearItem,
- "",
- "",
- 0,
- 0x8000,
- kClearItem
- };
-
- resource rPString (kClearItem, nocrossbank)
- {
- "Clear"
- };
-
- resource rMenuItem (kSelectItem, nocrossbank)
- {
- kSelectItem,
- "A",
- "a",
- 0,
- 0x8040, /* the "4" means this one has a divider under it */
- kSelectItem
- };
-
- resource rPString (kSelectItem, nocrossbank)
- {
- "Select All"
- };
-
- resource rMenuItem (kShowClipItem, nocrossbank)
- {
- kShowClipItem,
- "",
- "",
- 0,
- 0x8000,
- kShowClipItem
- };
-
- resource rPString (kShowClipItem, nocrossbank)
- {
- "Show Clipboard"
- };
-
-
- /*---------------------- Windows --------------------------*/
- /* define the resource ID's for all windows used by this app */
- #define myWindowID 2362 /* window's resource ID = 2362 */
-
- /* First, we lay out the window itself */
- resource rWindParam1 (myWindowID)
- {
- fTitle+fMove+fVis, /* has a title, can be moved, and it is visible */
- myWindowID, /* resource ID of the title */
- 0, /* no ref Con needed */
- {0,0,0,0}, /* no zoom box, so we don't care about the zoom rect */
- 0, /* use std color table for now */
- {0,0}, /* upper left corner of vis rgn = upper left of document */
- {0,0}, /* we don't really have a "document" for this window, so */
- /* set the data size to zero */
- {0,0}, /* maximum height and width */
- {0,0}, /* don't scroll vertically or horizontally */
- {0,0}, /* no "document", so page size is zero also */
- 0, /* passed to info bar draw routine - not used here */
- 0, /* height of info bar - not used here */
- {46,100,176,540}, /* this rect defines the boundaries of the window */
- infront, /* window comes up in front of other windows */
- 0, /* set to NIL to avoid bug in NewWindow2 */
- refIsResource*0x0100+resourceToResource /* title string and */
- /* control list are resources */
- };
-
- /* define the title string used by our window */
- resource rPstring (myWindowID)
- {
- " This came from a resource "
- };
-
-
-
- /*--------- Alert Window - used as our About Box --------------------*/
-
- #define kAboutStr 100 /* define the constant for the About box's string */
-
- resource rAlertString (kAboutStr)
- {
- "\$30" /* we're using a custom sized box */
- "\$1E\$00" /* top coord (v1) for custom sized box */
- "\$AA\$00" /* left coord (h1) for custom sized box */
- "\$B0\$00" /* bottom coord (v2) for custom sized box */
- "\$D6\$01" /* right coord for (h2) custom sized box */
- "\$30" /* no icon in the window */
- "/" /* seperator character */
- TBEndOfLine /* stick an extra blank line in there */
- TBEndOfLine /* stick an extra blank line in there */
- TBCenterJust /* center the text */
- TBStyleBold /* turn on bold face */
- "rTutor.S16" /* the first line of text */
- TBEndOfLine /* mark the end of the line */
- TBEndOfLine /* stick an extra blank line in there */
- TBStylePlain /* turn off bold face */
- "The Rez tutorial application" /* the next line of text */
- TBEndOfLine /* mark the end of the line */
- TBEndOfLine /* stick an extra blank line in there */
- TBStylePlain /* turn off italics */
- TBForeColor /* set foreground color to... */
- TBColor0 /* ...black */
- "written by:" /* another line of text */
- TBEndOfLine /* mark the end of the line */
- TBEndOfLine /* stick an extra blank line in there */
- TBForeColor /* set foreground color to... */
- TBColor1 /* ...red */
- "Tim Swihart" /* the name of this app's author */
- TBEndOfLine /* mark the end of the line */
- TBEndOfLine /* stick an extra blank line in there */
- TBEndOfLine /* stick an extra blank line in there */
- TBStylePlain /* turn off bold face */
- TBForeColor /* set foreground color to... */
- TBColor0 /* ...black */
- "Version 3.3" /* last line of text */
- "/" /* "/" is our seperator character */
- "^Thanks, Tim!" /* "^" means make the button the "default" (tie it to */
- /* the RETURN key) - make the button's text be "Thanks, Tim!" */
- "\$00" /* make sure the string is NULL terminated since we told */
- /* the window manager we would be using a C string */
- };
-
-
- /*---------------------- Icons ---------------------------*/
- #define kFloorIcon 1 /* for the floor tiles */
-
- resource rIcon (kFloorIcon, purgeable1, nocrossbank)
- {
- 0x8000, /* bit 15 = 1, so it's a color icon */
- 8, /* height = 8 pixels */
- 8, /* width = 8 pixels */
- $"555555FF" /* array of pixels in the icon's image */
- $"5EEEE5FF"
- $"85EE58FF"
- $"A8558AFF"
- $"A8558AFF"
- $"85EE58FF"
- $"5EEEE5FF"
- $"555555FF",
-
- $"FFFFFF00" /* array of pixels in the icon's image */
- $"FFFFFF00"
- $"FFFFFF00"
- $"FFFFFF00"
- $"FFFFFF00"
- $"FFFFFF00"
- $"FFFFFF00"
- $"FFFFFF00";
- };
-
-
-
-
- /*---------------------- Cursors ---------------------------*/
-
- #define rFirstCursor 1
-
- resource rCursor (rFirstCursor, fixed)
- {
- 16, /* height of rCursor */
- 3, /* width in words */
- { /* array of hex NUMBERS or integers for cursor */
- 0x3FFC,0x3FFC,0x0000,
- 0xC03F,0xFC03,0x0000,
- 0x3C3C,0x3C0F,0x0000,
- 0xC030,0xCC00,0x0000,
- 0x0C30,0x0C0C,0x0000,
- 0x0CC0,0x030C,0x0000,
- 0x00C0,0x0300,0x0000,
- 0x0FC0,0x03FC,0x0000,
- 0x30C0,0x0303,0x0000,
- 0x3330,0x0C33,0x0000,
- 0x3330,0x0C33,0x0000,
- 0x3030,0x0C03,0x0000,
- 0x0F0C,0x30FC,0x0000,
- 0x0F03,0xC03C,0x0000,
- 0xF300,0x00F3,0x0000,
- 0x0F00,0x00FC,0x0000
- },
- { /* array for mask */
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000,
- 0xFFFF,0xFFFF,0x0000
- },
- 8, /* hot spot Y */
- 8, /* hot spot X */
- 1 /* cursor ID */
- };
-